package com.masc.gurr.model;

import java.util.ArrayList;

public class Group {
	private String name;
	private ArrayList<Contact> contacts;
	private ArrayList<Group> subgroups;
	
	public Group(String name) {
		this.name = name;
		subgroups = new ArrayList<Group>();
		contacts = new ArrayList<Contact>();
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public ArrayList<Contact> getContacts() {
		return contacts;
	}
	public void setContacts(ArrayList<Contact> contacts) {
		this.contacts = contacts;
	}
	public ArrayList<Group> getSubgroups() {
		return subgroups;
	}
	public void setSubgroups(ArrayList<Group> subgroups) {
		this.subgroups = subgroups;
	}
	public void addSubGroup(Group pSubGroup) {
		this.subgroups.add(pSubGroup);
	}
	public void addContact(Contact pContact) {
		this.contacts.add(pContact);
		pContact.setGroupRef(this);
	}
}
